 <{extends file="<{$tempdir}>/public/wxsite.html"}>  
 <{block name=extendcss}> 
<link rel="stylesheet"  href="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/css/public1.css">   
 <{/block}>
<{block name=myScrolljs}> <!-- 
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/js/newweixin.js"></script> --> 
<script> 
		var myScroll;
function loaded() {
	myScroll = new iScroll('wrapper', {
		useTransform: false,
		onBeforeScrollStart: function (e) {
			var target = e.target;
			while (target.nodeType != 1) target = target.parentNode;

			if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA')
				e.preventDefault();
		}
	});
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false); 
document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
</script>
 

<{/block}>
<{block name=hearnav}>
<div class="toptitCon">
 <div class="toptitBox">
  <div class="toptitL"><i></i></div>
  <div class="toptitC"><h3>申请退款</h3></div>
 </div>
</div><{/block}>
<{block name=sitetitle}><{$sitename}><{/block}>
<{block name=blockcontent}>  
<style>
.page-app{ background:#f0f0f0;}
body{background:#f0f0f0;
}
.liwd30{ width:10%; background:#fff; text-align:center; font-size:15px; line-height:45px;height:45px;color:#333333;font-weight:bold;  }
.box_set{ padding:0px 12px; background:#fff; }
.drawbackliyou{padding:0px 12px; background:#fff;}
.drawbackliyou .liwd90{width:100%;text-align:left; font-size:15px; line-height:45px;height:45px;color:#333333;font-weight:bold; }
.liwd90 input{ width:25px; height:25px; margin-top:14px; }
.drawbox{ border-bottom:1px solid #f0f0f0;}
.drawcontent{ padding:0px 12px; background:#fff; height:100px; margin-top:20px; margin-bottom:10px;}
.drawcontent liwd90{  border:none;}
.drawcontent textarea{ background:#fff; height:76px; padding:12px 0px ;  width:100%; border:none;  }
.sqdraw{padding:0px 12px;}
.sqdraw .liwd90{ width:100%;font-size:16px; background:#ff6e6e; color:#fff; text-align:center; height:42px; line-height:42px; font-weight:bold;border-radius:5px;}
</style>
	 <div id="wrapper" style="top:40px; bottom:0px;">
	<div id="scroller">
<!--提示-->
<div class="refundprompt"><i></i><span>商家确认后，款项将会原路退回</span></div>

<!--退款金额-->
<div class="refundmon">
 <ul>
  <li>退款金额</li>
  <li class="refunrig"><span>￥<b  id="allcost" style="color:#ff0000;"><{$order['allcost']}></b></span></li>
 </ul>
</div>	

<{if $order['paytype'] ==1   && $order['paystatus'] == 1 && empty($order['is_reback'])}>
	

<!--退款原因-->
<div class="refundreacon">
 <div class="refundreatit"><span>退款原因</span><b>(须选一项)</b></div>
 <div class="refundrea">
  <ul>
  
  	<{if !empty($drawsmlist)}>
                    	<{$list = $drawsmlist|unserialize}>
                       <{foreach from=$list key=myid item=items}>	 
                       <{if !empty($items)}>
  
   <li><i></i><input  type="radio"  name="drawreason"  ><span><{$items}></span></li> <!-- refunaA -->
   
   
     <{/if}>
                    <{/foreach}>  
                    <{/if}>
   
  </ul>
 </div>
</div>
<!--问题描述-->
<div class="refunddesc"><textarea  name="drawcontent" id="drawcontent"   placeholder="详细描述您遇到的问题，有助于更快处理退款"></textarea></div>

<input type="hidden" name="orderid"  value="<{$order['id']}>">

<div class="intexchabutt"><input type="button" value="申请退款" id="feedbackSubmit"  class="intexbg1"></div>
	<div style="height:20px;"></div>	
 
<{else}>
 
 
	<div class="drawbackliyou" style="margin:20px 0px;">
			 
		 
		<div class="box_inline drawbox" >
				<div class="liwd90" style="width:100%;font-size:16px;" >
					退款状态
				</div>
		 
			 
		</div>
 
			<div class="box_inline drawbox" >
			 
				<div class="liwd90" style="width:100%;font-size:14px;  color:#fb4e44;color:red; font-weight:normal;">
					<{if $drawbacklog['status'] == 0 }>待处理<{elseif $drawbacklog['status'] ==  1}>已退款，请在对应的支付账户中查看<{elseif $drawbacklog['status'] ==  2}>拒绝退款，如有疑问请联系商家<{/if}>
				</div>
			 
		</div>
		 
	</div>
	
	
	
	<div class="drawbackliyou">
		<div class="box_inline drawbox" >
				<div class="liwd90" style="width:100%;font-size:16px;" >
					退款原因
				</div>
		 
			 
		</div>
 
			<div class="box_inline drawbox" >
			 
				<div class="liwd90" style="width:100%;font-size:14px; color:#6B450A; font-weight:normal;">
					<{$drawbacklog['reason']}>
				</div>
			 
		</div>
	 
	
	</div>
		
	
	<div class="drawbackliyou" style="margin-top:20px;">
		<div class="box_inline drawbox" >
				<div class="liwd90" style="width:100%;font-size:16px;" >
					退款详细说明
				</div>
		 
			 
		</div>
 
			<div class="box_inline drawbox" >
			 
				<div class="liwd90" style="width:100%;font-size:14px; color:#6B450A; font-weight:normal;">
					<{$drawbacklog['content']}>
				</div>
			 
		</div>
	 
	
	</div>
	 
	<div class="sqdraw" style="margin-bottom:20px;margin-top:20px;">
		<div class="box_inline" >
				<div class="liwd90"  onclick="dolink('<{ofunc type=url link="/wxsite/ordershow/orderid/<{$drawbacklog['orderid']}>"}>');"   >
					返回上一步
				</div>
		 
			 
		</div>
	</div>
	
<{/if}>
	
	
</div>
</div>
 <script>
 
 $(".refundrea li").click(function(){
 
	$(".refundrea li i").removeClass('refunaA');
	$(this).find('i').addClass('refunaA');
 
 });
 
 
 	$('#feedbackSubmit').click(function(){   
  	   	$('#loading').toggle(); 
			var allcost = $("#allcost").text();
 			var reason = $(".refundrea li i.refunaA").parent().find('span').text(); 
			var info = {'allcost':allcost,'reason':reason,'orderid': $("input[name='orderid']").val(),'typeid':0,'content':$('#drawcontent').val()};  
		    var url =  siteurl+'/index.php?ctrl=wxsite&action=savedrawbacklog&datatype=json&random=@random@';  
		     $.ajax({ 
             url: url.replace('@random@', 1+Math.round(Math.random()*1000)), 
            dataType: "json", 
            data:info, 
            success:function(content) { 

            	   $('#loading').toggle();
            	   if(content.error ==  false){
            	   	Tmsg('申请成功!');
							$('.closegb').live("click", function() {   
								 $('.popup').slideToggle('slow',function(){$('#mask').remove();$('.popup').remove();}); 
								 window.location.href=  siteurl+'/index.php?ctrl=wxsite&action=ordershow&orderid=<{$order['id']}>' ;
								 
							});
							
            	   }else{
            	   	Tmsg(content.msg);
            	   }

            },

            error:function(){

            	   $('#loading').toggle();

            }

         });  
	 });
 </script>
<{/block}>

  <{block name=footer}> <{/block}>
